﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AAA.Meta.Command
{
    public class CommandProfile
    {
        private string _strCommand;
        private string _strReturnCode;
        private string _strReturnMessage;
        private Dictionary<string, string> _dicData;

        public CommandProfile()
        {
            _dicData = new Dictionary<string, string>();
        }

        public string Command
        {
            get { return _strCommand; }
            set { _strCommand = value; }
        }

        public string ReturnCode
        {
            get { return _strReturnCode; }
            set { _strReturnCode = value; }
        }

        public string ReturnMessage
        {
            get { return _strReturnMessage; }
            set { _strReturnMessage = value; }
        }

        public Dictionary<string, string> Data
        {
            get { return _dicData; }
            set { _dicData = value; }
        }

        public void SetValue(string strName, string strValue)
        {
            if (_dicData.ContainsKey(strName))
                _dicData.Remove(strName);
            _dicData.Add(strName, strValue);
        }

        public string GetValue(string strName)
        {
            return _dicData.ContainsKey(strName)
                    ? _dicData[strName]
                    : null;
        }
    }
}
